package edu.kit.csl.cratylus.datatypes;

/**
 * This class encapsulates the set of important properties of a target word 
 * candidate. This set consists of the word ( = phoneme sequence) itself, and
 * its position in a sentence pair in the corpus. 
 */
public class Candidate {
	
	/*
	 * Field variables
	 */
	private Word word;
	private boolean noise;
	private int pos;
	private SentencePair pair;
	
	/**
	 * Sole constructor. Directly specifies all important properties of the 
	 * target word candidate as the phoneme sequence itself, its position,
	 * and the associated sentence pair.
	 * 
	 * @param word the phoneme sequence itself
	 * @param pos the position of the target word in the sentence pair
	 * @param pair the sentence pair containing the candidate
	 */
	public Candidate(Word word, int pos, SentencePair pair) {
		this.word = word;
		this.pos = pos;
		this.pair = pair;
		this.noise = false;
	}
	
	/**
	 * Getter method for the phoneme sequence itself.
	 * 
	 * @return the word
	 */
	public Word getWord() {
		return word;
	}
	
	/**
	 * Get the position of the target word in the sentence pair's target
	 * sentence.
	 * 
	 * @return the position of the target word candidate
	 * @see #getPair()
	 */
	public int getPosition() {
		return pos;
	}
	/**
	 * Get the sentence pair in which the candidate occurs.
	 * 
	 * @return the sentence pair containing the target word candidate
	 */
	public SentencePair getPair() {
		return pair;
	}

	/**
	 * Checks if this candidate is marked as noise.
	 * 
	 * @return if this candidate is marked as noise
	 */
	public boolean isNoise() {
		return noise;
	}

	/**
	 * Set the noise marker. This should normally be done by a splitter.
	 * 
	 * @param noise the noise to set
	 */
	public void setNoise(boolean noise) {
		this.noise = noise;
	}
}
